<template>
	<view class="main">
		<!-- <view class="content-card">
			<uni-card title="基础卡片" sub-title="副标题" extra="额外信息"
				thumbnail="https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/460d46d0-4fcc-11eb-8ff1-d5dcf8779628.png">
				<text>这是一个带头像和双标题的基础卡片，此示例展示了一个完整的卡片。</text>
			</uni-card>
		</view> -->
		<view class="content-news">
			<view class="news-box" v-for="(item,index) in list" :key="index">
				<view class="news-title">
					<text>{{item.title}}</text>
				</view>
				<view class="news-card">
					<view class="img">
						<image :src="item.qyimg" mode=""></image>
					</view>
					<view class="text">
						<text>{{item.qyname}}</text>
						<view class="tip">
							<view :class="'a '+[item.zt=='拒绝'?'':'tip-bu']+[item.zt=='通过'?' x':'']">{{item.zt}}</view>
						</view>
					</view>
				</view>

			</view>
		</view>
	</view>

</template>

<script>
	import axios from "axios"
	export default {

		data() {
			return {
				username: '',
				list: [],
				// list: [{
				// 		id: 1,
				// 		title:"ss",
				// 		img: "/static/img/1.svg",
				// 		name: "零贰玖小馆",
				// 		tip: '通过'
				// 	},
				// 	{
				// 		id: 2,
				// 		title:"sss",
				// 		img: "/static/img/2.svg",
				// 		name: "孟非的小面",
				// 		tip: '拒绝'
				// 	},
				// 	{
				// 		id: 3,
				// 		title:"ssss",
				// 		img: "/static/img/3.svg",
				// 		name: "品珍斋",
				// 		tip: '抉择'
				// 	}
				// ]

			}
		},
		onShow() {

		},

		mounted() {
			const xsname = uni.getStorageSync('userlist')[0].name
			if (xsname) {
				axios.get('/api/shenqinglistxs?xsname=' + xsname)
					.then(res => {
						console.log(res.data);
						this.list = res.data
					})
			}


			// http.request({
			// 	url: '/msglist'
			// }).then(res => {
			// 	console.log(res.data);

			// }).catch(res => {
			// 	console.log('404');
			// })
		},
		methods: {

		}
	}
</script>

<style scoped lang="scss">
	.main {
		width: 100%;
		height: 100%;
	}

	.content-news {
		height: 100%;
		width: 100%;
		display: flex;
		flex-direction: column;

		.news-box {

			padding: 0 40rpx;
			border-top: 1px solid #CCCCCC;
		}

		.news-title {
			font-size: 36rpx;

		}

		.news-card {
			width: 90%;
			height: 100rpx;
			// margin: auto;
			display: flex;

			.img {
				width: 80rpx;
				height: 80rpx;
				margin: auto;

				image {
					width: 100%;
					height: 100%;
				}
			}
		}

		.text {
			height: 100%;
			width: 100%;
			line-height: 100rpx;
			display: flex;

			justify-content: space-between;

		}

		.tip {
			// padding-right: 5%;
			// width: 30%;
			display: flex;
			justify-content: space-around;

			.a {
				color: #CCCCCC;

			}

			.tip-bu {

				color: #0099CC;

			}

			.x {
				color: #FF6666;
			}
		}
	}
</style>
